<%@page import="com.drerp.RH.Colaborador"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="StyleSheet" href="../styles.css" type="text/css" media=screen />

<style type="text/css">
	.inner_center p {
		margin: 8px 30px;
	}
	
	label {
		font-weight: bold;
	}
</style>

<title>Demitir Colaborador</title>

</head>
<body>

<jsp:include page="/nav/header.jsp" />

<div class="body">
	
	<jsp:include page="/nav/menu.jsp" />
	
	<div class="center">
	
		<h1>Afastar Colaborador</h1>
		
		<%
			try {
				Long colabId = Long.parseLong(request.getParameter("id"));
				Colaborador colab = Colaborador.encontrarColaboradorPorId(colabId);
		%>
		<form action="demitir.jsp" method="post" id="formulario">
			<input type="hidden" name="id" value="<%= colabId %>" />
			
			<div class="inner_center">
				<div class="title" style="width: 250px;">Dados Demissionais</div>
				
				<p style="margin-top: 20px;">
					<label>Nome do Funcionário: </label>
					<%= colab.getNome() %>
				</p>
				
				<p>
					<label>Data do aviso prévio: </label>
					<select name="dia_aviso"> 
						<% for(int i = 1;i < 32; i++){ %>
							<option><%= i %></option>
						<% } %>
					</select> 
					<select name="mes_aviso"> 
						<% for(int i = 1; i < 13; i++){ %>
							<option><%= i %></option>
						<% } %>
					</select> 
					<select name="ano_aviso"> 
						<% for(int i = 2011; i > 1900; i--){ %>
							<option><%= i %></option>
						<% } %>
					</select> 
				</p>
					
				<p>
					<label>Data do afastamento: </label>
					<select name="dia_afastamento"> 
						<% for(int i = 1;i < 32; i++){ %>
							<option><%= i %></option>
						<% } %>
					</select> 
					<select name="mes_afastamento"> 
						<% for(int i = 1; i < 13; i++){ %>
							<option><%= i %></option>
						<% } %>
					</select> 
					<select name="ano_afastamento"> 
						<% for(int i = 2011; i > 1900; i--){ %>
							<option><%= i %></option>
						<% } %>
					</select> 
				</p>
				
				<p>
					<label>Causa do afastamento: </label>
					<input type="text" name="causa_afastamento" style="width: 400px;" />
				</p>
				
				<br />
				<div style="float: right; margin: 10px 20px;">
					<input type="submit" class="button" value="Afastar" />&nbsp;&nbsp;|&nbsp;&nbsp;<a href="lista.jsp">Voltar</a>
				</div>
				
			</div>
		</form>
		
		<%
			} catch(Exception e) {
		%>
			<p>Ocorreu um erro.</p>
		<%
			}
		%>
		
		
		
	</div>
</div>